package cn.com.pajx.pajx_visitor_v3.api;

import java.util.LinkedHashMap;
import java.util.List;

import io.reactivex.Observable;
import okhttp3.MultipartBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.PartMap;
import retrofit2.http.Streaming;
import retrofit2.http.Url;

/**
 * create by ruancw on 2024/2/28
 * 数据请求接口
 */

public interface ApiService {
    //获取数据
    @FormUrlEncoded
    @POST
    Observable<HttpResponse> getRemoteData(@Url String url, @FieldMap LinkedHashMap<String, String> map);

    //上传文件
    @Multipart
    @POST
    Observable<HttpResponse> upLoadFile(@Url String url, @Part List<MultipartBody.Part> file, @PartMap LinkedHashMap<String, String> map);

    //上传图片
    @Multipart
    @POST
    Observable<HttpResponse> upLoadPhoto(@Url String url, @Part MultipartBody.Part file, @PartMap LinkedHashMap<String, String> map);

    //下载文件
    @FormUrlEncoded
    @Streaming
    @POST
    Observable<ResponseBody> downloadFile(@Url String url, @FieldMap LinkedHashMap<String, String> map);

    @Streaming
    @GET
    Call<ResponseBody> downloadFileSync(@Url String url);

}
